import Vue from 'vue';
import Router from 'vue-router';
// import Login from "../components/pages/login"
import Main from '../components/pages/main';
// const Promotion = () => import("../components/pages/Promotion")
const Produce = () => import('../components/pages/produce/produce.vue');
const AllProduce = () => import('../components/pages/all_produce/all_produce.vue');
// const Run = () => import("../components/pages/run")
const Manage = () => import('../components/pages/manage');
// const MyDevice = () => import("../components/pages/myDevice")
// const DeviceDetailRun = () => import("../components/pages/deviceDetailRun")
// const CheckHistory = () => import("../components/pages/checkHistory")
// const CheckHistoryDetail = () => import("../components/pages/checkHistoryDetail")
// const AddCheckHistory = () => import("../components/pages/addCheckHistory")
const DeviceDetailManage = () => import('../components/pages/deviceDetailManage');
// const DeviceReplaceList = () => import("../components/pages/deviceReplaceList")
// const DeviceSeeRecordComponent = () => import("../components/pages/deviceSeeRecordComponent")
// const AddReplace = () => import("../components/pages/addReplace")
// const Opportunity = () => import("../components/pages/opportunity/opportunity.vue")
const InventoryManage = () => import('../components/pages/inventory/inventoryManage');
const InventoryTree = () => import('../components/pages/inventory/inventoryTree');
// const Homepage = () => import("../components/pages/homepage")
// const OperaionManage = () => import("../components/pages/operaionManage")
// const OperaionManage = () => import("../components/pages/operaionManage1")
const SpotCheck = () => import('../components/pages/spotCheck');
// const AddDeviceCheck = () => import("../components/pages/addDeviceCheck")
const AddComponentCheck = () => import('../components/pages/addComponentCheck');
const DeviceCheckRecord = () => import('../components/pages/deviceCheckRecord');
const ComponentCheckRecord = () => import('../components/pages/componentCheckRecord');
// const WorkSheetDetail = () => import("../components/pages/workSheetDetail")
const SystemMessage = () => import('../components/pages/system_message/systemMessage');
const SystemMessageDetails = () => import('../components/pages/system_message/systemMessageDetails');
const Earlywarning = () => import('../components/pages/earlywarning');
const EarlywarningDetails = () => import('../components/pages/earlywarningDetails');
const WorkSheetHomePage = () => import('../components/pages/workSheetHomePage');
// const WorkSheetManage = () => import("../components/pages/workSheetManage")
// const WorkSheetInfo = () => import("../components/pages/workSheetInfo")
// const DeviceInfo = () => import("../components/pages/deviceInfomation")
// const Personality = () => import("../components/pages/userinfo/personality")
// const PersonalityInformation = () => import("../components/pages/userinfo/personalityInformation")
// const MyOrder = () => import("../components/pages/userinfo/myOrder")
// const ChangePassword = () => import("../components/pages/userinfo/changePassword")
const EnterpriseSwitch = () => import('../components/pages/enterpriseSwitch');
const Structure = () => import('../components/pages/structure');
const StructureSecond = () => import('../components/pages/structureSecond');
const StructureThird = () => import('../components/pages/structureThird');
const StructureFourth = () => import('../components/pages/StructureFourth');
const StructureFifth = () => import('../components/pages/StructureFifth');
// const ChooseChecker = () => import("../components/pages/chooseChecker")
const ReplaceAdd = () => import('../components/pages/replace/replaceAdd');
const ReplaceDetail = () => import('../components/pages/replace/replaceDetail');
// const AddComponentReplace = () => import("../components/pages/addComponentReplace")
// const HistoryWorkOrder = () => import("../components/pages/historyWorkOrder")
const WorkOrderDetails = () => import('../components/pages/workOrderDetails');
// const SearchResult = () => import("../components/pages/searchResult")
const SubmitWorkOrder = () => import('../components/pages/submitWorkOrder');
// const ComponentCheck = () => import("../components/pages/componentCheck1")
// const RemindManage = () => import("../components/pages/remindManage")
// const RemindManageDetail = () => import("../components/pages/remindManageDetail")
// const SubmitRemindRecord = () => import("../components/pages/submitRemindRecord")
// const RemindHomePage = () => import("../components/pages/remindHomePage")
// const ComponentReplace = () => import("../components/pages/componentReplace")
// const ComponentReplaceList = () => import("../components/pages/componentReplaceList")
const ChooseTransfer = () => import('../components/pages/chooseTransfer');
const DataAnalysis = () => import('../components/pages/dataAnalysis');
const sellWorkOrder = () => import('../components/pages/sellWorkOrder');
const DeviceInfos = () => import('../components/pages/deviceInfos');
// const DeviceDataDetail = () => import("../components/pages/deviceDataDetail")
const ScanCodeLogin = () => import('../components/pages/ScanCodeLogin');
const FinanceDetail = () => import('../components/pages/financeDetail');
const AddFinance = () => import('../components/pages/addFinance');
const DeviceFinanceList = () => import('../components/pages/deviceFinanceList');
const WorkOrderFinance = () => import('../components/pages/workOrderFinance');
const DeviceCheckOverViewPage = () => import('../components/pages/deviceCheckOverViewPage');
const Certificate = () => import('../components/pages/safetymanage/certificate');
const CertificateManage = () => import('../components/pages/safetymanage/certificate_manage');
const SafetyCheck = () => import('../components/pages/safetymanage/safetyCheck');
const SafetyCheckList = () => import('../components/pages/safetymanage/safetyCheckList');
const SafetyCheckResult = () => import('../components/pages/safetymanage/safetyCheckResult');
const SafetyCheckResultList = () => import('../components/pages/safetymanage/safetyCheckResultList');
const SafetyCheckResultDetail = () => import('../components/pages/safetymanage/safetyCheckResultDetail');
const InspectionPlan = () => import('../components/pages/safetymanage/safetyInspectionPlan');
const RisksControl = () => import('../components/pages/safetymanage/safetyRisksControl');
const RisksControlList = () => import('../components/pages/safetymanage/safetyRisksControlList');
const SafetyRisks = () => import('../components/pages/safetymanage/safetyRisks');
const SafetyRisksResult = () => import('../components/pages/safetymanage/safetyRisksResult');
const SafetyRisksDetail = () => import('../components/pages/safetymanage/safetyRisksDetail');
const SafetyOperationList = () => import('../components/pages/safetymanage/safetyOperationList');
const SafetyOperationApprove = () => import('../components/pages/safetymanage/safetyOperationApprove');
const EnergyConsume = () => import('../components/pages/energy_consume/index');
const EnergyConsumeDetail = () => import('../components/pages/energy_consume/energy_consume_detail.vue');
const OutboundList = () => import('../components/pages/replace/outboundList.vue');
const OutboundDetail = () => import('../components/pages/replace/outboundDetail.vue');
const OutboundAdd = () => import('../components/pages/replace/outboundAdd.vue');
const WorkLogs = () => import('../components/pages/work_logs/work_logs');
const WorkLogsAdd = () => import('../components/pages/work_logs/work_logs_add');

const g6issue = () => import('../components/pages/g6issue.vue');

Vue.use(Router);

const originalPush = Router.prototype.push;
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject);
  return originalPush.call(this, location).catch((err) => err);
};

let router = new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      name: 'main',
      component: Main,
      meta: {
        title: 'IU工业云平台',
      },
    },
    // {
    //   path: '/',
    //   name: 'Promotion',
    //   component: Promotion,
    //   meta: {
    //     title: 'IU工业云平台'
    //   }
    // },
    {
      path: '/ScanCodeLogin',
      name: 'ScanCodeLogin',
      component: ScanCodeLogin,
      meta: {
        title: '扫码登录',
      },
    },
    // {
    //   path: '/opportunity',
    //   name: 'opportunity',
    //   component: Opportunity,
    //   meta: {
    //     title: '发布需求'
    //   }
    // },
    /* {
      path: '/',
      name: 'login',
      component: Login,
      meta: {
        title: '登录'
      }
    }, */
    {
      path: '/produce',
      name: 'produce',
      component: Produce,
      meta: {
        title: '生产统计',
      },
    },
    {
      path: '/produceData',
      name: 'produceData',
      component: () => import('@/components/pages/produce/produceData'),
      meta: {
        title: '生产数据',
      },
    },
    {
      path: '/produceData/add',
      name: 'addProduceData',
      component: () => import('@/components/pages/produce/addProduceData'),
      meta: {
        title: '生产数据',
      },
    },
    {
      path: '/produceData/edit',
      name: 'editProduceData',
      component: () => import('@/components/pages/produce/editProduceData'),
      meta: {
        title: '生产数据',
      },
    },
    {
      path: '/produce/allProduce',
      name: 'allProduce',
      component: AllProduce,
      meta: {
        title: '全部生产数据',
      },
    },
    {
      path: '/produceDaily',
      name: 'produceDaily',
      component: () => import('@/components/pages/produce/produceDaily'),
      meta: {
        title: '生产日报',
      },
    },
    {
      path: '/produce/dailyreport',
      name: 'produceDailyDetail',
      component: () => import('@/components/pages/produce/dailyDetail'),
      meta: {
        title: '日报详情',
      },
    },
    // {
    //   path: '/run',
    //   name: 'run',
    //   component: Run,
    //   meta: {
    //     title: '设备运行'
    //   },
    // },
    // {
    //   path: '/run/myDevice',
    //   name: 'myDevice',
    //   component: MyDevice,
    //   meta: {
    //     title: '巡检历史'
    //   }
    // },
    // {
    //   path: '/run/deviceDetailRun',
    //   name: 'deviceDetailRun',
    //   component: DeviceDetailRun,
    //   meta: {
    //     title: '设备信息'
    //   }
    // },
    // {
    //   path: '/run/deviceDetailRun/checkHistory',
    //   name: 'checkHistory',
    //   component: CheckHistory,
    //   meta: {
    //     title: '巡检记录'
    //   }
    // },
    // {
    //   path: '/run/deviceDetailRun/checkHistory/checkHistoryDetail',
    //   name: 'checkHistoryDetail',
    //   component: CheckHistoryDetail,
    //   meta: {
    //     title: '添加巡检记录'
    //   }
    // },
    // {
    //   path: '/run/deviceDetailRun/addCheckHistory',
    //   name: 'addCheckHistory',
    //   component: AddCheckHistory,
    //   meta: {
    //     title: '添加巡检记录'
    //   }
    // },
    {
      path: '/manage',
      name: 'manage',
      component: Manage,
      meta: {
        title: '设备管理',
      },
    },
    {
      path: '/manage/deviceDetailManage',
      name: 'deviceDetailManage',
      component: DeviceDetailManage,
      meta: {
        title: '设备管理',
      },
    },
    // {
    //   path: '/manage/deviceDetailManage/deviceInfo',
    //   name: 'deviceInfo',
    //   component: DeviceInfo,
    //   meta: {
    //     title: '设备信息'
    //   }
    // },
    {
      path: '/manage/deviceDetailManage/deviceInfos',
      name: 'deviceInfos',
      component: DeviceInfos,
      meta: {
        title: '设备信息',
      },
    },
    {
      path: '/manage/deviceDetailManage/financeDetail',
      name: 'financeDetail',
      component: FinanceDetail,
      meta: {
        title: '设备财务详情',
      },
    },
    {
      path: '/manage/deviceFinanceList',
      name: 'deviceFinanceList',
      component: DeviceFinanceList,
      meta: {
        title: '财务记录',
      },
    },
    {
      path: '/workSheetHomePage/workOrderFinance',
      name: 'workOrderFinance',
      component: WorkOrderFinance,
      meta: {
        title: '工单财务记录',
      },
    },
    {
      path: '/manage/deviceDetailManage/addFinance',
      name: 'addFinance',
      component: AddFinance,
      meta: {
        title: '添加财务记录',
      },
    },
    // {
    //   path: '/manage/deviceDetailManage/deviceDataDetail',
    //   name: 'deviceDataDetail',
    //   component: DeviceDataDetail,
    //   meta: {
    //     title: '设备数据详情'
    //   }
    // },
    {
      path: '/manage/deviceDetailManage/replaceAdd',
      name: 'replaceAdd',
      component: ReplaceAdd,
      meta: {
        title: '更换添加',
      },
    },
    {
      path: '/manage/deviceDetailManage/replaceDetail',
      name: 'replaceDetail',
      component: ReplaceDetail,
      meta: {
        title: '更换详情',
      },
    },
    // {
    //   path: '/manage/deviceDetailManage/addReplace',
    //   name: 'addReplace',
    //   component: AddReplace,
    //   meta: {
    //     title: '新增更换'
    //   }
    // },
    // {
    //   path: '/manage/deviceDetailManage/deviceReplaceList',
    //   name: 'deviceReplaceList',
    //   component: DeviceReplaceList,
    //   meta: {
    //     title: '更换记录'
    //   }
    // },
    // {
    //   path: '/manage/deviceDetailManage/componentReplace',
    //   name: 'componentReplace',
    //   component: ComponentReplace,
    //   meta: {
    //     title: '更换记录'
    //   }
    // },

    // {
    //   path: '/manage/deviceDetailManage/componentReplaceList',
    //   name: 'componentReplaceList',
    //   component: ComponentReplaceList,
    //   meta: {
    //     title: '设备更换记录'
    //   }
    // },
    {
      path: '/manage/deviceDetailManage/inventoryTree',
      name: 'inventoryTree',
      component: InventoryTree,
      meta: {
        title: '部件管理',
      },
    },
    {
      path: '/manage/deviceDetailManage/inventoryManage',
      name: 'inventoryManage',
      component: InventoryManage,
      meta: {
        title: '入库管理',
      },
    },
    /* {
      path: '/homepage',
      name: 'homepage',
      component: Homepage,
      meta: {
        title: '首页'
      }
    }, */
    {
      path: '/operaionManage',
      name: 'operaionManage',
      component: () => import('@/components/pages/operaionManage'),
      meta: {
        title: '运维管理',
      },
    },
    {
      path: '/operaionManage/spotCheck',
      name: 'spotCheck',
      component: SpotCheck,
      meta: {
        title: '点巡检',
      },
    },
    {
      path: '/operaionManage/addCheck',
      name: 'addDeviceCheck',
      component: () => import('@/components/pages/addDeviceCheck1'),
      meta: {
        title: '添加设备点巡检',
      },
    },
    {
      path: '/operaionManage/addComponentCheck',
      name: 'addComponentCheck',
      component: AddComponentCheck,
      meta: {
        title: '添加部件点巡检',
      },
    },
    {
      path: '/operaionManage/spotCheck/deviceCheckRecord',
      name: 'deviceCheckRecord',
      component: DeviceCheckRecord,
      meta: {
        title: '设备点巡检记录',
      },
    },
    {
      path: '/operaionManage/spotCheck/componentCheckRecord',
      name: 'componentCheckRecord',
      component: ComponentCheckRecord,
      meta: {
        title: '部件点巡检记录',
      },
    },
    {
      path: '/operaionManage/spotCheck/workSheetDetail',
      name: 'workSheetDetail',
      component: () => import('@/components/pages/workSheetDetail1'),
      meta: {
        title: '点巡检详情',
      },
    },
    {
      path: '/operaionManage/deviceCheckOverViewPage',
      name: 'deviceCheckOverViewPage',
      component: DeviceCheckOverViewPage,
      meta: {
        title: '点巡检详情',
      },
    },
    {
      path: '/operaionManage/outboundList',
      name: 'outboundList',
      component: OutboundList,
      meta: {
        title: '出库单列表',
      },
    },
    {
      path: '/operaionManage/outboundDetail',
      name: 'outboundDetail',
      component: OutboundDetail,
      meta: {
        title: '出库单详情',
      },
    },
    {
      path: '/operaionManage/outboundAdd',
      name: 'outboundAdd',
      component: OutboundAdd,
      meta: {
        title: '出库单新增',
      },
    },
    {
      path: '/workLogs',
      name: 'workLogs',
      component: WorkLogs,
      meta: {
        title: '工作日志',
      },
    },
    {
      path: '/workLogsAdd',
      name: 'workLogsAdd',
      component: WorkLogsAdd,
      meta: {
        title: '工作日志',
      },
    },
    {
      path: '/workSheetHomePage',
      name: 'workSheetHomePage',
      component: WorkSheetHomePage,
      meta: {
        title: '工单管理',
      },
    },
    {
      path: '/systemMessage',
      name: 'systemMessage',
      component: SystemMessage,
      meta: {
        title: '系统消息',
      },
    },
    {
      path: '/systemMessageDetails',
      name: 'systemMessageDetails',
      component: SystemMessageDetails,
      meta: {
        title: '系统消息详情',
      },
    },
    {
      path: '/earlywarning',
      name: 'earlywarning',
      component: Earlywarning,
      meta: {
        title: '预警管理',
      },
    },
    {
      path: '/earlywarning/earlywarningDetails',
      name: 'earlywarningDetails',
      component: EarlywarningDetails,
      meta: {
        title: '预警详情',
      },
    },
    {
      path: '/safetyManage',
      name: 'safetyManage',
      component: Certificate,
      meta: {
        title: '证书管理',
      },
    },
    {
      path: '/safetyManage/certificateManage',
      name: 'certificate_manage',
      component: CertificateManage,
      meta: {
        title: '证书管理',
      },
    },
    {
      path: '/safetyCheck',
      name: 'safetyCheck',
      // component: SafetyCheck,
      component: InspectionPlan,
      meta: {
        title: '安全检测',
      },
    },
    {
      path: '/safetycheck/list',
      name: 'safetyCheckList',
      component: SafetyCheckList,
      meta: {
        title: '安全检测',
      },
    },
    {
      path: '/safetycheck/result',
      name: 'safetyCheckResult',
      component: SafetyCheckResult,
      meta: {
        title: '隐患排查',
      },
    },
    {
      path: '/safetycheck/resultlist',
      name: 'safetyCheckResultList',
      component: SafetyCheckResultList,
      meta: {
        title: '检查详情',
      },
    },
    {
      path: '/safetycheck/resultdetail',
      name: 'safetyCheckResultDetail',
      component: SafetyCheckResultDetail,
      meta: {
        title: '检查结果详情',
      },
    },
    {
      path: '/safetycheck/inspectionPlan',
      name: 'inspectionPlan',
      component: InspectionPlan,
      meta: {
        title: '检查计划',
      },
    },
    {
      path: '/safetycheck/risksControl',
      name: 'risksControl',
      component: RisksControl,
      meta: {
        title: '检查计划',
      },
    },
    {
      path: '/safetycheck/risksControl/list',
      name: 'risksControlList',
      component: RisksControlList,
      meta: {
        title: '检查计划',
      },
    },
    {
      path: '/safetycheck/safetyRisks',
      name: 'safetyRisks',
      component: SafetyRisks,
      meta: {
        title: '隐患列表',
      },
    },
    {
      path: '/safetycheck/safetyRisksDetail',
      name: 'safetyRisksDetail',
      component: SafetyRisksDetail,
      meta: {
        title: '隐患详情',
      },
    },
    {
      path: '/safetycheck/safetyRisksResult',
      name: 'safetyRisksResult',
      component: SafetyRisksResult,
      meta: {
        title: '隐患整改',
      },
    },
    {
      path: '/safetyExamine',
      name: 'safetyExamine',
      component: SafetyOperationList,
      meta: {
        title: '审批',
      },
    },
    {
      path: '/safetyExamine/safetyOperationApprove',
      name: 'safetyOperationApprove',
      component: SafetyOperationApprove,
      meta: {
        title: '审批',
      },
    },
    {
      path: '/energyConsume',
      name: 'energyConsume',
      component: EnergyConsume,
      meta: {
        title: '能耗管理',
      },
    },
    {
      path: '/energyConsume/detail',
      name: 'energy_consume_detail',
      component: EnergyConsumeDetail,
      meta: {
        title: '用量详情',
      },
    },
    // {
    //   path:'/workSheetHomePage/workSheetManage',
    //   name:'workSheetManage',
    //   component:WorkSheetManage,
    //   meta:{
    //     title:'工单管理'
    //   }
    // },
    // {
    //   path:'/workSheetManage/workSheetInfo',
    //   name:'workSheetInfo',
    //   component:WorkSheetInfo,
    //   meta:{
    //     title:'工单信息'
    //   }
    // },
    // {
    //   path: '/personality',
    //   name: 'personality',
    //   component: Personality,
    //   meta: {
    //     title: '个人中心'
    //   }
    // },
    // {
    //   path: '/personalityInformation',
    //   name: 'personalityInformation',
    //   component: PersonalityInformation,
    //   meta: {
    //     title: '个人信息'
    //   }
    // },
    // {
    //   path: '/personality/myOrder',
    //   name: 'myOrder',
    //   component: MyOrder,
    //   meta: {
    //     title: '我的订单'
    //   }
    // },
    // {
    //   path: '/changePassword',
    //   name: 'changePassword',
    //   component: ChangePassword,
    //   meta: {
    //     title: '密码修改'
    //   }
    // },
    {
      path: '/enterpriseSwitch',
      name: 'enterpriseSwitch',
      component: EnterpriseSwitch,
      meta: {
        title: '企业切换',
      },
    },
    {
      path: '/structure',
      name: 'structure',
      component: Structure,
      meta: {
        title: '组织架构',
      },
    },
    {
      path: '/structureSecond',
      name: 'structureSecond',
      component: StructureSecond,
      meta: {
        title: '二级组织架构',
      },
    },
    {
      path: '/structureThird',
      name: 'structureThird',
      component: StructureThird,
      meta: {
        title: '三级组织架构',
      },
    },
    {
      path: '/structureFourth',
      name: 'structureFourth',
      component: StructureFourth,
      meta: {
        title: '四级组织架构',
      },
    },
    {
      path: '/structureFifth',
      name: 'structureFifth',
      component: StructureFifth,
      meta: {
        title: '五级组织架构',
      },
    },
    // {
    //   path: '/manage/deviceDetailManage/chooseChecker',
    //   name: 'chooseChecker',
    //   component: ChooseChecker,
    //   meta: {
    //     title: '选择点巡检审核人'
    //   }
    // },
    // {
    //   path: '/manage/deviceDetailManage/addComponentReplace',
    //   name: 'addComponentReplace',
    //   component: AddComponentReplace,
    //   meta: {
    //     title: '添加部件更换记录'
    //   }
    // },
    // {
    //   path: '/workSheetHomePage/historyWorkOrder/',
    //   name: 'historyWorkOrder',
    //   component: HistoryWorkOrder,
    //   meta: {
    //     title: '历史工单记录'
    //   }
    // },
    // {
    //   path: '/workSheetHomePage/searchResult/',
    //   name: 'searchResult',
    //   component: SearchResult,
    //   meta: {
    //     title: '搜索结果'
    //   }
    // },
    {
      path: '/workSheetHomePage/workOrderDetails/',
      name: 'workOrderDetails',
      component: WorkOrderDetails,
      meta: {
        title: '工单详情',
      },
    },
    {
      path: '/workSheetManage/workSheetInfo/submitWorkOrder/',
      name: 'submitWorkOrder',
      component: SubmitWorkOrder,
      meta: {
        title: '提交工单处理',
      },
    },
    {
      path: '/operaionManage/spotCheck/componentCheck',
      name: 'componentCheck',
      component: () => import('@/components/pages/componentCheck1'),
      meta: {
        title: '部件点巡检',
      },
    },
    {
      path: '/operaionManage/spotCheck/overdue',
      name: 'overDue',
      component: () => import('@/components/pages/overdue'),
      meta: {
        title: '逾期记录',
      },
    },
    // {
    //   path:'/operaionManage/spotCheck/checkAndReplaceSetList',
    //   name:'checkAndReplaceSetList',
    //   component:() => import('@/components/pages/checkAndReplaceSetList'),
    //   meta:{
    //     title:'点巡检设置'
    //   }
    // },
    // {
    //   path: '/manage/remindHomePage',
    //   name: 'remindHomePage',
    //   component: RemindHomePage,
    //   meta: {
    //     title: '提醒管理首页'
    //   }
    // },
    // {
    //   path: '/manage/remindHomePage/remindManage',
    //   name: 'remindManage',
    //   component: RemindManage,
    //   meta: {
    //     title: '提醒管理'
    //   }
    // },
    // {
    //   path: '/manage/remindHomePage/remindManageDetail',
    //   name: 'remindManageDetail',
    //   component: RemindManageDetail,
    //   meta: {
    //     title: '提醒管理详情'
    //   }
    // },
    // {
    //   path: '/manage/remindHomePage/submitRemindRecord',
    //   name: 'submitRemindRecord',
    //   component: SubmitRemindRecord,
    //   meta: {
    //     title: '提交提醒记录'
    //   }
    // },
    {
      path: '/operaionManage/chooseTransfer',
      name: 'chooseTransfer',
      component: ChooseTransfer,
      meta: {
        title: '选择转办人',
      },
    },
    {
      path: '/dataAnalysis',
      name: 'dataAnalysis',
      component: DataAnalysis,
      meta: {
        title: '数据分析',
      },
    },
    {
      path: '/sellWorkOrder',
      name: 'sellWorkOrder',
      component: sellWorkOrder,
      meta: {
        title: '新建工单',
      },
    },
    {
      path: '/commentDetails',
      name: 'commentDetails',
      component: () => import('@/components/pages/workOrderCommentDetails'),
      meta: {
        title: '工单信息',
      },
    },
    {
      path: '/g6issue',
      name: 'g6issue',
      component: g6issue,
      meta: {
        title: '云组态',
      },
    },
  ],
});
// 解决Loading chunk (\d)+ failed问题
router.onError((error) => {
  console.error(error);
  const pattern = /Loading chunk/g;
  const isChunkLoadFailed = error.message.match(pattern);
  const targetPath = router.history.pending.fullPath;
  if (isChunkLoadFailed && error.type === 'missing') {
    router.push(targetPath);
  }
});

// 解决Loading chunk (\d)+ failed问题
router.onError((error) => {
  console.error(error);
  const pattern = /Loading chunk/g;
  const isChunkLoadFailed = error.message.match(pattern);
  const targetPath = router.history.pending.fullPath;
  if (isChunkLoadFailed && error.type === 'missing') {
    router.push(targetPath);
  }
});

export default router;
